The present invention relates to a focusing device for detecting a focusing condition of an object image using a CCD line sensor.
Conventionally, a focusing device using a CCD line sensor has been known. In the conventional focusing device, an analog image signal, which represents received light amounts for respective pixels, output by the line sensor is converted into a digital image signal having signal values representing received light amount of the respective pixels, a contrast is obtained by calculating the sum of differences of the signal values between adjoining pixels, and determines the focusing condition based on thus obtained contrast.
In the conventional focusing device, however, if the contrast of an object is relatively low, the focusing condition cannot be detected at a high reliability. Therefore, in the conventional focusing device, if the contrast is low, the output of the line sensor is amplified, or an integration period of the line sensor is increased, and then the output signals are shifted (i.e., a predetermined value is subtracted therefrom) using an operational amplifier.
Such configurations result in a complicated circuitry constitution of the focusing device.
It is therefore an object of the invention to provide an improved focusing device which is capable of detecting the focusing condition at a high precision with a simple circuitry structure.
For the above object, according to the present invention, there is provided a focusing device, which is provided with:
an image sensor having a plurality of light receiving elements which receive an image of an object and output analog video signals, respectively;
an analog-to-digital converter which converts the analog video signal output by the image sensor into first digital data having a first precision;
a data converting system that is capable converting the first digital data into either of second digital data and third digital data, the second digital data having a second precision which is lower than the first precision, the third digital data having a third precision which is lower than the second precision;
a contrast calculation system that calculates contrast based on data converted by the data converting system to obtain contrast of the object; and
a judging system that judges whether the contrast obtained by the contrast calculation system is smaller than a predetermined reference value,
wherein if the judging system judges that the contrast obtained based on the third digital data is smaller than the reference value, the contrast calculation system calculates the contrast based on the second digital data.
The contrast is firstly obtained based on lower precision data. Then, if the obtained contrast is lower than a reference value, the contrast is obtained again based on higher precision data. Therefore, focusing condition can always be detected precisely without making the circuitry constitution will no be complicated.
For example, the second precision is twice as precise as the third precision. In particular case, the first, second, third data may be 10-bit, 9-bit and 8-bit data, respectively.
Optionally, the second data is (n+1)-bit data, n being an integer, and the third data is n-bit data, n being an integer. Further, the data obtained by the subtraction system is n-bit data having substantially the same precision as the second data, and the contrast calculation system may calculate the contrast based on the data obtained by the subtraction system.
It is preferable that the focusing device further includes a subtraction system that subtracts a predetermined shift amount from the second data. In particular case, the second precision may correspond to a precision of 9-bit data and the third precision may correspond to a precision of 8-bit data, and the subtraction system may convert the second data to an 8-bit data by subtracting the shift amount from the data value of the second data. In this case, the shift amount may be a predetermined fixed value. Alternatively, the shift amount may be calculated based on maximum data value and minimum data value of the second data. In this case, the shift amount may be calculated as an averaged value of the maximum data value and the minimum data value.